<%-- 
    Document   : comentario
    Created on : 26-jun-2013, 19:40:19
    Author     : davidcabrera
--%>
<%@page import="negocio.Pista"%>
<%@page import="negocio.dao.DAO"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="es">
<head>
    <title>Comentario</title>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" media="screen" href="css/reset.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/style.css">
    <link rel="stylesheet" type="text/css" media="screen" href="css/grid_12.css">
    <script src="js/jquery-1.7.min.js"></script>
    <script src="js/jquery.easing.1.3.js"></script>
    <script src="js/cufon-yui.js"></script>
    <script src="js/Asap_400.font.js"></script>
    <script src="js/Coolvetica_400.font.js"></script>
    <script src="js/Kozuka_M_500.font.js"></script>
    <script src="js/cufon-replace.js"></script>
    <script src="js/FF-cash.js"></script>

</head>
<body>
    <div class="main">
        <div class="bg-img"></div>
        <!--==============================header=================================-->
         <header>
                <h1><a href="index.jsp">Sport <strong>Club</strong></a></h1>

                <div style="margin-top: 30px; margin-left: 750px">        

                </div> 
                <div >
                    
                <logic:empty name="usuario" scope="session">
                        <html:form action="/login" >
                            <div>
                            <table border="0" class="login-form">
                                <tbody>
                                    <tr>
                                        <td><strong>Email:</strong></td>
                                        <td><html:text property="email" name="LoginForm" style="text-align:right"/></td>
                                    </tr>
                                    <tr>
                                        <td><strong>Clave:</strong></td>
                                        <td><html:password property="pass" name="LoginForm" style="text-align:right"/></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="button" style="text-align:right;"><html:submit value="Login"/></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" style="text-align:right"><a href="registro.jsp" class="color-1">¡Registrate!</a></td>
                                    </tr>

                                </tbody>
                            </table>
                                    </div>
                        </html:form>
                    </logic:empty>
                        
                        <logic:notEmpty name="usuario" scope="session">
                            <div style="text-align: right" >
                            Bienvenido, <strong><a class="link" href="cuenta.do"><bean:write name="usuario" property="nombre"/></a></strong>

                            <br/>
                            <a class="link" href="unlogin.do" >Desconectar</a>
                            </div>
                        </logic:notEmpty>
                    
                </div>


                <nav style="clear: both">
                    
                    <ul class="menu">
                        <li><a href="index.jsp">Principal</a></li>
                        <li class="current"><a href="instalaciones.do">Instalaciones</a></li>
                        <li><a href="galeria.jsp">Galeria</a></li>
                        <li><a href="contacta.jsp">Contacta</a></li>
                    </ul>
                </nav>
            </header>   
        <!--==============================content================================-->
        <section id="content">
            <div class="container_12">
                <div class="grid_12">
                    <div class="box-shadow">
                        <div class="wrap block-2">
                            
                            <!-- division izq-->
                            <div class="col-3">
                                <h2>Informacion <span class="color-1">Pista</span></h2>
                                <div class="img-border">
                                    <%
                                        DAO d= new DAO();
                                        Pista p=(Pista)d.read("Pista", Integer.valueOf(request.getParameter("idp")));
                                    
                                    %>
                                    <img src="images/<%= p.getFoto() %>" style="width: 215px"/>
                                </div>

                                <dl>
                                    <dt class="color-1"><strong><%= p.getNombre() %></strong></dt>
                                    <dd><strong>Tipo:</strong> <%= p.getTipo() %></dd>
                                    <dd><strong>Precio:</strong> <%= p.getPrecio() %></dd>
                                    <dd><strong>Descripción:</strong>  <%= p.getDescripcion() %></dd>
                                </dl>
                            </div>
                            
                            
                            <!-- Division derecha-->
                            <div class="col-4">
                                <h2><span class="color-1">Comenta</span></h2>
                                <%
                                    String idp=request.getParameter("idp");
                                %>
                                <html:errors/>
                                <html:form action="/comentar" styleId="form" >
                                    <fieldset>
                                        <label><html:text value="Nombre"  property="nombreUsuario" onblur="if(this.value=='') this.value='Nombre'" onfocus="if(this.value =='Nombre' ) this.value=''" /></label>
                                        <label><html:textarea value="Comentario" property="descripcion" onblur="if(this.value=='') this.value='Comentario'" onfocus="if(this.value =='Comentario' ) this.value=''" /></label>
                                     
                                        <html:hidden name="id" property="idPista" value="<%=idp%>" />
                                        <div class="btns">
                                            <a href="#" class="button" onClick="document.getElementById('form').submit()">Enviar</a>
                                            <a href="#" class="button" onClick="document.getElementById('form').reset()">Borrar</a>
                                           
                                        </div>
                                    </fieldset>  
                                </html:form>
                               
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </section> 
        <!--==============================footer=================================-->
    </div>
    <%@include file="footer.jsp" %>
</body>
</html>
